package com.pitaya.avatar.servlet.logger;

import java.io.IOException;
import javax.servlet.ServletException;   
import javax.servlet.ServletRequest;   
import javax.servlet.ServletResponse;   
import javax.servlet.http.HttpServlet;   

import org.apache.log4j.xml.DOMConfigurator;
   
@SuppressWarnings("serial")
public class Log4jInitServlet  extends HttpServlet {

	public void service(ServletRequest req, ServletResponse resp) throws ServletException, IOException {           
	}
       
    public void init() throws ServletException {   
    	 String appFilePath = getServletContext().getRealPath("/");
         System.setProperty("webappRoot", appFilePath);

         DOMConfigurator.configure(appFilePath + getInitParameter("configfile"));   
     }
}

